package com.method;

/**
 * person类
 * 2017/8/15
 * @author Erik
 * @version 0.1
 * @since JDK1.8.
 */
public class Person {
    private String name;
    private String sex;
    private int age;

    public Person(){}

    public Person(String name,String sex,int age){
        this.setName(name);
        this.setSex(sex);
        this.setAge(age);
    }

    public void setName(String name)    {   this.name=name; }
    public void setSex(String sex)      {   this.sex=sex;   }
    public void setAge(int age)         {   this.age=age;   }

    public String getName()     {   return this.name;   }
    public String getSex()      {   return this.sex;    }
    public int getAge()         {   return this.age;    }


    public String toSting() {
        String str="姓名: "+this.getName()+"   年龄: "+this.getAge()+"   性别: "+this.getSex();
        return str;
    }
}
